<?php

/**
 * ParticipationDetail form base class.
 *
 * @package    form
 * @subpackage participation_detail
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseParticipationDetailForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'participation_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Participation', 'add_empty' => false)),
      'input_id'         => new sfWidgetFormDoctrineSelect(array('model' => 'Input', 'add_empty' => false)),
      'qty'              => new sfWidgetFormInput(),
      'price'            => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorDoctrineChoice(array('model' => 'ParticipationDetail', 'column' => 'id', 'required' => false)),
      'participation_id' => new sfValidatorDoctrineChoice(array('model' => 'Participation')),
      'input_id'         => new sfValidatorDoctrineChoice(array('model' => 'Input')),
      'qty'              => new sfValidatorNumber(array('required' => false)),
      'price'            => new sfValidatorNumber(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('participation_detail[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ParticipationDetail';
  }

}